<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

<canvas id="canvas" width="1024" height="768" style="border: 1px solid #aaa; display: block; margin: auto auto">
	<!--兼容降错-->
	当前浏览器不支持 Canvas，请更换浏览器后再试
</canvas>

<!--圆-->
<script>
window.onload = function () {
	const canvas = document.getElementById('canvas')
	const context = canvas.getContext('2d')

	context.lineWidth = 5
	// 填充颜色
	context.fillStyle = '#005588'

	for (let i = 0; i < 10; i++) {
		context.beginPath()
		context.arc(50 + i*100, 60, 40, 0, 2*Math.PI*(i+1)/10)
		context.closePath()
		context.fill()	// 填充
	}

	for (let i = 0; i < 10; i++) {
		context.beginPath()
		context.arc(50 + i*100, 180, 40, 0, 2*Math.PI*(i+1)/10)
		context.fill()	// 填充
	}
}
</script>

</body>
</html>
